﻿<%@ Page Title="" Language="C#" MasterPageFile="~/InventoryTracker/MasterPage.master" AutoEventWireup="true" CodeFile="CustomerMaster.aspx.cs" 
    Inherits="InventoryTracker_CustomerMaster" %>
<asp:Content ID="Content1" ContentPlaceHolderID="maincontent" Runat="Server">
    <div id="projectreport">
        <a name="content_start0" id="content_start0"></a>
        <fieldset>
            <h2 class="none">
                Customer Mastert</h2>
            <legend>Customer Information</legend>
            <div class="formsection">
                Customer</div>
            <table  >
            <tr>
            <td>
            <asp:DropDownList ID="DdlCustomerName" runat="server" AutoPostBack="True" 
                    DataSourceID="SqlDSCustName" DataTextField="CustName" DataValueField="CustID" 
                    onselectedindexchanged="DdlCustomerName_SelectedIndexChanged"></asp:DropDownList>
            
                <asp:SqlDataSource ID="SqlDSCustName" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    SelectCommand="SELECT [CustID], [CustName] FROM [CustomerMaster]">
                </asp:SqlDataSource>
            
                </td>
                <td >
                    <p style="width: 170px; height: 44px">
                        <asp:Label ID="lblCustName" runat="server" Text="Customer Name"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ControlToValidate="txtCustName"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                            <asp:TextBox ID="txtCustName" runat="server"></asp:TextBox>
                    </p>
                    <p style="width: 170px; height: 44px">
                        <asp:Label ID="CustAddr1ID" runat="server" Text="Customer Address 1"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtCustAddr1ID"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        <asp:TextBox ID="txtCustAddr1ID" runat="server" TextMode="MultiLine" 
                            Width="150px" Height="22px" Columns="1" ></asp:TextBox>
                        
                    </p>
                    <p style="width: 170px; height: 44px">
                        <asp:Label ID="CustAddr2ID" runat="server" Text="Address 2"></asp:Label>
                        <asp:TextBox ID="txtCustAddr2ID" runat="server" TextMode="MultiLine" Width="150px" Height="22px" ></asp:TextBox>
                    </p>
                    <p style="width: 170px; height: 44px">
                        <asp:Label ID="CustAddr3ID" runat="server" Text="Address 3"></asp:Label>
                        <asp:TextBox ID="txtCustAddr3ID" runat="server" TextMode="MultiLine" Width="150px" Height="22px" ></asp:TextBox>
                    </p>
                    <p style="width: 170px; height: 44px">
                        <asp:Label ID="lblCustCity" runat="server" Text="City"></asp:Label>
                        
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtCustCity"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        <br/>
                        <asp:TextBox ID="txtCustCity" runat="server"></asp:TextBox>
                        
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" 
                            ControlToValidate="txtCustCity" ErrorMessage="Enter only Characters." 
                            ValidationExpression="^[a-zA-Z\s.]*$"></asp:RegularExpressionValidator>
                        
                    </p>
                    <p style="width: 170px; height: 44px">
                        <asp:Label ID="lblCustState" runat="server" Text="State"></asp:Label>
                        
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtCustState"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        <br/>
                        <asp:TextBox ID="txtCustState" runat="server"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator6" runat="server" 
                            ControlToValidate="txtCustState" ErrorMessage="Enter only Characters." 
                            ValidationExpression="^[a-zA-Z\s.]*$"></asp:RegularExpressionValidator>
                        
                    </p>
                    <p style="width: 170px; height: 44px">
                        <asp:Label ID="lblCustCountry" runat="server" Text="Country"></asp:Label>
                        
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtCustCountry"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        <br/>
                        <asp:TextBox ID="txtCustCountry" runat="server"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator7" runat="server" 
                            ControlToValidate="txtCustCountry" ErrorMessage="Enter only Characters." 
                            ValidationExpression="^[a-zA-Z\s.]*$"></asp:RegularExpressionValidator>
                        
                    </p>
            </td>
            <td  >
           
                    <p style="width: 170px; height: 44px">
                        <asp:Label ID="lblCustPhone" runat="server" Text="Phone No"></asp:Label>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ControlToValidate="txtCustPhone"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        <br />
                            <asp:TextBox ID="txtCustPhone" runat="server"></asp:TextBox>
                            
                            <asp:RegularExpressionValidator ID="RegularExpressionValidator2" ControlToValidate="txtCustPhone"
                                runat="server" ErrorMessage="Invalid Phone No:" ValidationExpression="^[0-9]*$" SetFocusOnError="True"></asp:RegularExpressionValidator>
                    </p>
                    <p style="height: 44px">
                        
                        <asp:Label ID="lblCustMobile" runat="server" Text="Mobile No."></asp:Label>
                        <br />
                        <asp:TextBox ID="txtCustMobile" runat="server"></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator3" ControlToValidate="txtCustMobile"
                            runat="server" ErrorMessage="Invalid Mobile No:" ValidationExpression="^[0-9]*$" 
                            SetFocusOnError="True"></asp:RegularExpressionValidator>
                        
                    </p>
                    <p style="height: 44px">
                        <asp:Label ID="lblCustFax" runat="server" Text="Fax"></asp:Label>
                        <br />
                        
                        <asp:TextBox ID="txtCustFax" runat="server" onkeypress="return allowonlynumbers();" ></asp:TextBox>
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator4" ControlToValidate="txtCustFax"
                        runat="server" ErrorMessage="Invalid Fax No:" ValidationExpression="^[0-9]*$" SetFocusOnError="True"></asp:RegularExpressionValidator>

                    </p>
                    <p style="width: 170px; height: 49px;">
                        <asp:Label ID="lblCustEmail" runat="server" Text="EMail"></asp:Label>
                        <br />
                        <asp:TextBox ID="txtCustEMail" runat="server"></asp:TextBox>
                        <br />
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator1" 
                        runat="server" ErrorMessage="Enter a valid E-Mail ID." 
                            ControlToValidate="txtCustEMail" 
                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
                        
                    </p>
                    <p style="height: 44px">
                        <asp:Label ID="lblCustZipCode" runat="server" Text="ZipCode"></asp:Label>
                        
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ControlToValidate="txtCustZipCode"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        <br />
                        <asp:TextBox ID="txtCustZipCode" runat="server"></asp:TextBox>
                        
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator10" ControlToValidate="txtCustZipCode"
                         runat="server" ErrorMessage="Enter only Numbers." ValidationExpression="^[0-9]*$" 
                            SetFocusOnError="True"></asp:RegularExpressionValidator>
                        
                    </p>
                    <p style="height: 44px">
                        <asp:Label ID="lblCustLeadTime" runat="server" Text="LeadTime"></asp:Label>
                        
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ControlToValidate="txtCustLeadTime"
                        ErrorMessage="*" ></asp:RequiredFieldValidator>
                        
                        <br />
                        <asp:TextBox ID="txtCustLeadTime" runat="server"></asp:TextBox>
                        
                        <asp:RegularExpressionValidator ID="RegularExpressionValidator8" ControlToValidate="txtCustLeadTime"
                          runat="server" ErrorMessage="Enter only Numbers." ValidationExpression="^[0-9]*$" 
                            SetFocusOnError="True"></asp:RegularExpressionValidator>
                        
                    </p>
                    
                    <p>
                       <asp:Label ID="lblCustStatus" runat="server" Text="Status:" 
                            Font-Strikeout="False" Font-Underline="True"></asp:Label>
                        
                       <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" ControlToValidate="RDbtnListCust"
                       ErrorMessage="*" ></asp:RequiredFieldValidator>
                       
                       <asp:RadioButtonList ID="RDbtnListCust" runat="server"  CausesValidation="True">
                       <asp:ListItem>Active</asp:ListItem>
                       <asp:ListItem>Inactive</asp:ListItem>
                       </asp:RadioButtonList>
                   </p>
                    
                    
         
        
            </td>
            </tr>
            </table>
            
            <asp:Label ID="lblWarn" runat="server" Text="* Required Fields" 
                ForeColor="Red"></asp:Label>
            <div class="formsection">
            <asp:Button ID="btnCustConti" runat="server" Text="Continue" Visible="true" 
                    onclick="btnCustConti_Click" style="width: 77px"></asp:Button>
                <asp:Button ID="btnCustSubmit" runat="server"  Text="Submit" 
                    onclick="btnCustSubmit_Click" style="width: 61px"/>
                    <asp:Button ID="btnCustNew" runat="server" Text="New" 
                    onclick="btnCustNew_Click"></asp:Button>
                    <asp:Button ID="btnCustDelete" runat="server" Text="Delete" 
                    onclick="btnCustDelete_Click"></asp:Button>
                    <asp:Button ID="btnCustEdit" runat="server" Text="Edit" 
                    onclick="btnCustEdit_Click"></asp:Button>
                    <asp:Button ID="btnCustUpdate" runat="server" Text="Update" onclick="btnCustUpdate_Click" 
                    ></asp:Button>
                    <asp:Label ID="lblResult" runat="server"></asp:Label>
            </div>
        </fieldset>
        





<script type="text/javascript">function allowonlynumbers()

{
if(event.keyCode >= 48 && event.keyCode <= 57)

{
return true;

}

else

{
alert('Only numbers can be entered.');return false;

}

}

</script>
    </div>
</asp:Content>

